package com.yough.api.framework.main;

import com.yough.api.framework.core.parse.DocumentParser;
import com.yough.api.framework.core.parse.helper.JarDocumentParserHelper;

/**
 * @Description
 * @Author yough
 * @Version V1.0.0
 * @Since 1.0
 * @Date 2021/1/7
 */
public class ApiFrameworkMain {

    public static void main(String[] args) throws Exception {
        String sysNo = "2007";
        String jarFilePath = "F:\\Idea_Workspace\\Java-Senior-Projects\\Java-Practise-Projects\\simple-demo-api\\target\\simple-demo-api-1.0-SNAPSHOT.jar";
        parseJarFile(sysNo, jarFilePath);
    }

    public static void parseJarFile(String sysNo, String jarFilePath) throws Exception {
        DocumentParser documentParser = new DocumentParser();
        // 使用jar包文档解析辅助类
        JarDocumentParserHelper jarDocumentParserHelper = new JarDocumentParserHelper();
        jarDocumentParserHelper.setSysNo(sysNo);
        // 设置文档解析器
        documentParser.setDocumentParser(jarDocumentParserHelper);
        // 解析文档，生成api文档
        documentParser.parseDocument(jarFilePath);
    }
}
